package com.fmy.test.config.dynamic.holder;

/**
 * @Auther: Mr.fmy
 * @Date: 2019/8/24 0024 17:17
 * @Description: <p>
 * 动态数据源自定义切换类
 * </p>
 */
public class DynamicContextHolder {

    private static ThreadLocal<DynamicHolderModel> threadLocal = new ThreadLocal<>();

    public static DynamicHolderModel get() {
        return threadLocal.get();
    }

    public static void set(DynamicHolderModel db) {
        threadLocal.set(db);
    }

    public static void remove() {
        threadLocal.remove();
    }
}
